package practice4.aop;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.FileSystemResource;

import practice4.aop.bl.Player;

public class SpringAopTest {
	public   static void main(String[] args) throws UnsupportedEncodingException {
		String url = SpringAopTest.class.getResource("").getPath();
		url = URLDecoder.decode(url, "UTF-8");
		ApplicationContext  ctx = new FileSystemXmlApplicationContext(url+"applicationContext.xml");

//		Player p = (Player) ctx.getBean("PaulCarter");
		Player p = (Player) ctx.getBean("PaulCarterProxy");
		p.play();
		System.out.println("-----------------------------");
	}
}
